package com.sy.controller;

import com.sy.entity.Subject;
import com.sy.service.SubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * description: SubjectController <br>
 * date: 2022/6/28 3:24 PM <br>
 * author: zoumaoji <br>
 * version: 1.0 <br>
 */

@RestController
@RequestMapping("subject")
public class SubjectController {
    @Autowired
    private SubjectService subjectService;

    @RequestMapping("all")
    public List<Subject> selectAllSubject() {
        return subjectService.selectAllSubject();
    }

    @RequestMapping("get")
    public Subject getSubjectById(Integer subjectId){
        return subjectService.getSubjectById(subjectId);
    }
}
